<template>
	<view>
		<u-navbar back-text="返回" backIconColor="#fff" :customBack="back" :backTextStyle="backTextColor"
			:background="background">
		</u-navbar>
		<view>
			<u-image :src="image" @click="click" :height="height" borderRadius="12"  mode="aspectFit"></u-image>
			<bottomRight :padding="padding" :list="rightList" :image="image"></bottomRight>
		</view>
	</view>
</template>

<script>
	import bottomRight from '@/components/bottomRight.vue';
	export default {
		components: {
			bottomRight
		},
		data() {
			return {
				background: this.TopColor,
				backTextColor: {
					'color': '#ffffff'
				},
				padding: '0rpx',
				image: '',
				height: 0,
				rightList: [{
					icon: 'download',
					name: '下载'
				}, {
					icon: 'heart',
					name: '收藏'
				}, {
					icon: 'share',
					name: '分享'
				}]
			}
		},
		onLoad(e) {
			let system = uni.getSystemInfoSync();
			let height = (system.windowHeight - system.statusBarHeight - 44);
			let rpx = height / (uni.upx2px(100) / 100);
			this.height = parseInt(rpx);
			if (e.img) {
				console.log("详情")
				console.log(e.img)
				this.image = e.img;
			}
		},
		methods: {
			click() {
				console.log(this.image)
				this.$common.previewImage(0, [this.image]);
			},
			rmbClick() {
				this.showRmb = !this.showRmb
			},
			back() {
				if (getCurrentPages().length > 1) {
					console.log("a")
					uni.navigateBack({
						delta: 1
					});   
				} else {
					console.log("b")
					uni.switchTab({
						url: '/pages/index/index'
					});
				}
			}
		}
	}
</script>

<style lang="scss">
</style>